﻿using System;
using System.IO;
using System.Text;

namespace JH.GladeSharpCodeGenerator.GeneratorTest
{
    static class Program
    {
        static void Main(string[] args)
        {
            if(args.Length == 0)
            {
                Generator generator = new  VBGeneratorFromGlade();
                Console.Write(generator.TestClassesNames());
            }
            else
            {
                string input;
                using (var stream = new FileStream(args[0], FileMode.Open, FileAccess.Read))
                {
                    var reader = new StreamReader(stream);
                    input = reader.ReadToEnd();
                }

                Generator generator = new CSGeneratorFromGlade();
                var res = generator.TestGenerator(input, args[0]);
                var resStr = Encoding.UTF8.GetString(res);

                Console.Write(resStr);
            }
        }
    }
}
